Skip to content

test: multi signer e2e#7060

Merged
vitormattos merged 18 commits intomainfrom
test/multi-signer-e2e
Mar 3, 2026
Merged

test: multi signer e2e#7060
vitormattos merged 18 commits intomainfrom
test/multi-signer-e2e

Conversation

@vitormattos
Copy link
Copy Markdown
Member

No description provided.

@vitormattos vitormattos added this to the Next Major (34) milestone Mar 2, 2026
@vitormattos vitormattos self-assigned this Mar 2, 2026
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Mar 2, 2026
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable33

Upload PDF, add two email signers (signer01 and signer02), confirm the
'Sign in order' switch is visible and unchecked by default, send the
request and verify via mailpit that both signers receive their notification
email simultaneously, confirming parallel mode.

Signed-off-by: Vitor Mattos <[email protected]>
Upload PDF, add two email signers, enable 'Sign in order' switch, send
the request and verify via mailpit that only signer01 receives an email
immediately (signer02 is still in Draft). Then signer01 signs via the
email link and the test verifies that signer02 now receives their
notification, confirming sequential mode.

Signed-off-by: Vitor Mattos <[email protected]>
vuedraggable 4 (Vue 3) removed the default slot in favour of a named
#item slot. Using the old <transition-group> default-slot pattern causes
computeNodes() to throw "draggable element must have an item slot",
leaving componentStructure undefined and crashing the updated() hook.

Changes:
- add item-key="identify" (required by vuedraggable 4)
- replace <transition-group> default slot with <template #item="{ element, index }">
- remove orphaned .signer-list CSS transition classes (no longer used)

Signed-off-by: Vitor Mattos <[email protected]>
The draggable stub must render the #item named slot (not the default
slot) to match vuedraggable 4's internal contract. Without this the
stub never renders any Signer children, making all rendering assertions
pass vacuously.

- Replace template '<div><slot /></div>' with a loop over modelValue
  that yields '<slot name="item" :element :index />' per entry
- Add itemKey to accepted props (vuedraggable 4 requires it)
- Remove transition-group stub (no longer used in Signers.vue)

Signed-off-by: Vitor Mattos <[email protected]>
…signingOrder

The API returns signingOrder: 1 as the default for every signer.
When the user enables "Sign in order", onPreserveOrderChange() checked
Because git log -p === false, every signer was skipped and all remained at
order 1, causing the backend to notify all signers simultaneously
instead of sequentially.

Fix: detect duplicate orders with a Set comparison and force
re-assignment when duplicates are found.

Signed-off-by: Vitor Mattos <[email protected]>
Covers the case where all signers arrive from the API with
signingOrder: 1 (the backend default). Enabling sequential mode
must reassign unique sequential orders to each signer.

Signed-off-by: Vitor Mattos <[email protected]>
The previous condition only checked for a mismatch when the user had a
non-empty email address. Users without an email (e.g. the admin) would
silently pass through, letting the page load with nodeId: 0 and
showing the generic "Document not found" error.

Invert the guard: allow only when email matches, otherwise throw with
a clear message asking the user to log out.
Also improves the error message from the generic "Invalid user" to
"This document is not yours. Log out and use the sign link again."

Signed-off-by: Vitor Mattos <[email protected]>
…DifferentAccount

Six cases covering all branches of the guard:
- not authenticated → pass
- authenticated email matches signer email → pass
- authenticated user has no email set → throw
- authenticated user has different email → throw
- wrong email but token in progress (code set, not yet identified) → pass
- wrong email and token already used (identified) → throw

Signed-off-by: Vitor Mattos <[email protected]>
- Remove tab clicks: with only one method (email) enabled the tab bar
  is not rendered; clicking by role='tab' would hang or fail
- Add .click() before .fill() on the Email placeholder to trigger
  the Vue autocomplete event
- Replace getByRole('switch') with getByLabel(): NcCheckboxRadioSwitch
  renders as <input type="checkbox">, not role="switch" (upstream bug)

Signed-off-by: Vitor Mattos <[email protected]>
…r test

Selector fixes (same as parallel test):
- Remove tab clicks, add .click() before .fill(), use getByLabel() for
  the switch state and getByText() to toggle it (input is hidden by CSS)

Logout before sign link:
- The email sign link is for an unauthenticated flow; accessing it
  while the admin session is active triggers the new backend error.
  Log out via Settings menu before navigating to avoid this.

Validation page assertions:
- After signer01 signs, assert the validation page shows both signers,
  with signer02 still in 'Not signed yet' state, proving the sequential
  flow held at that point.

Signed-off-by: Vitor Mattos <[email protected]>
…slators

Using a generic {name} placeholder gives translators no context about
what the variable represents. Rename it to {signerName} so it is
immediately clear that the value is the signer's display name, email,
or "Unknown" if no identification is available.

Also improve the TRANSLATORS comments to reference {signerName}.

Signed-off-by: Vitor Mattos <[email protected]>
Replace five individual 'it' blocks that each set up a wrapper and
assert the same computed property with a single it.each table.
Each row is self-describing via the 'description' field shown in the
test name ($description). The reactive toggle test is kept separate
because it involves sequential state changes.

Signed-off-by: Vitor Mattos <[email protected]>
…signing

After signer01 signs and the validation page loads:
- Click 'Expand details of Signer 01' (verifies the new accessible label)
- Expand validation status and assert 'Document integrity verified' link
- Expand document certification and assert 'Document has not been' link

Signed-off-by: Vitor Mattos <[email protected]>
@vitormattos vitormattos force-pushed the test/multi-signer-e2e branch from 0c8b013 to fd93f21 Compare March 2, 2026 23:03
fill() sets the value atomically without firing real keyboard events,
so NcSelect's @search handler (driven by vue-select's input event)
doesn't trigger reliably in CI where the component may still be
mounting. pressSequentially() types character by character, firing
actual keyboard events that vue-select observes consistently.

Also removes the workaround that waited for the form to close before
opening the second dialog, which was masking the same root cause.

Signed-off-by: Vitor Mattos <[email protected]>
@vitormattos vitormattos force-pushed the test/multi-signer-e2e branch from fd93f21 to b79e586 Compare March 2, 2026 23:44
Without a delay, keystrokes are dispatched in microseconds and
vue-select may batch the input events, causing the @search handler
to not fire reliably before the debounce timeout. Adding delay:50
spaces out the keystrokes so each event propagates through the
Vue reactivity system before the next one arrives.

Signed-off-by: Vitor Mattos <[email protected]>
…rker errors

defineAsyncComponent triggers internal Vite dev-server fetch requests
when the component is registered. When the vitest worker closes after
all tests finish, those fetches are still pending, producing 13
'Closing rpc while fetch was pending' unhandled rejections.

Mocking the three async component modules prevents the dynamic
imports from ever being initiated during the test run.

Signed-off-by: Vitor Mattos <[email protected]>
@vitormattos vitormattos merged commit 63dd772 into main Mar 3, 2026
72 checks passed
@vitormattos vitormattos deleted the test/multi-signer-e2e branch March 3, 2026 01:10
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap Mar 3, 2026
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant